package com.wocai.jrt.admin.user.model;

import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Set;

import org.springframework.security.core.GrantedAuthority;

import com.vteba.security.user.Authority;
import com.vteba.security.user.IUserDetails;

public class User implements IUserDetails {
	private static final long serialVersionUID = -8770565267605741396L;
	private Set<GrantedAuthority> authorities;
	private List<ModuleMenu> moduleMenuList;
	
	private String roleIds;
	private Integer echo;
	
    /**
     * order by 排序语句
     * 对应数据库表字段 employee
     */
    private String orderBy;

    /**
     * 分页开始记录
     * 对应数据库表字段 employee
     */
    private Integer start;

    /**
     * 分页大小
     * 对应数据库表字段 employee
     */
    private int pageSize = 10;

    /**
     * 是否去重
     * 对应数据库表字段 employee
     */
    private boolean distinct;

    /**
     * 对应数据库表字段 employee.id
     */
    private String id;

    /**
     * 对应数据库表字段 employee.name
     */
    private String name;

    /**
     * 对应数据库表字段 employee.account
     */
    private String account;

    /**
     * 对应数据库表字段 employee.email
     */
    private String email;

    /**
     * 对应数据库表字段 employee.password
     */
    private String password;

    /**
     * 对应数据库表字段 employee.dept_id
     */
    private String deptId;

    /**
     * 对应数据库表字段 employee.dept_name
     */
    private String deptName;

    /**
     * 对应数据库表字段 employee.manager_id
     */
    private String managerId;

    /**
     * 对应数据库表字段 employee.manager_name
     */
    private String managerName;

    /**
     * 对应数据库表字段 employee.enable
     */
    private Boolean enable;

    /**
     * 对应数据库表字段 employee.create_date
     */
    private Date createDate;

    /**
     * 设置 order by 排序语句
     */
    public void setOrderBy(String orderBy) {
        this.orderBy = orderBy;
    }

    /**
     * 获得 order by 排序语句
     */
    public String getOrderBy() {
        return orderBy;
    }

    /**
     * 设置 start，分页开始记录
     */
    public void setStart(Integer start) {
        this.start = start;
    }

    /**
     * 获得 start，分页开始记录
     */
    public Integer getStart() {
        return start;
    }

    /**
     * 设置 pageSize，分页大小
     */
    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    /**
     * 获得 pageSize，分页大小
     */
    public int getPageSize() {
        return pageSize;
    }

    /**
     * 设置 distinct，是否去重
     */
    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    /**
     * 获得 distinct，是否去重
     */
    public boolean isDistinct() {
        return distinct;
    }

    /**
     * 获得字段 employee.id 的值
     *
     * @return the value of employee.id
     */
    public String getId() {
        return id;
    }

    /**
     * 设置字段 employee.id 的值
     *
     * @param id the value for employee.id
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * 获得字段 employee.name 的值
     *
     * @return the value of employee.name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置字段 employee.name 的值
     *
     * @param name the value for employee.name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获得字段 employee.account 的值
     *
     * @return the value of employee.account
     */
    public String getAccount() {
        return account;
    }

    /**
     * 设置字段 employee.account 的值
     *
     * @param account the value for employee.account
     */
    public void setAccount(String account) {
        this.account = account;
    }

    /**
     * 获得字段 employee.email 的值
     *
     * @return the value of employee.email
     */
    public String getEmail() {
        return email;
    }

    /**
     * 设置字段 employee.email 的值
     *
     * @param email the value for employee.email
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * 获得字段 employee.password 的值
     *
     * @return the value of employee.password
     */
    public String getPassword() {
        return password;
    }

    /**
     * 设置字段 employee.password 的值
     *
     * @param password the value for employee.password
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * 获得字段 employee.dept_id 的值
     *
     * @return the value of employee.dept_id
     */
    public String getDeptId() {
        return deptId;
    }

    /**
     * 设置字段 employee.dept_id 的值
     *
     * @param deptId the value for employee.dept_id
     */
    public void setDeptId(String deptId) {
        this.deptId = deptId;
    }

    /**
     * 获得字段 employee.dept_name 的值
     *
     * @return the value of employee.dept_name
     */
    public String getDeptName() {
        return deptName;
    }

    /**
     * 设置字段 employee.dept_name 的值
     *
     * @param deptName the value for employee.dept_name
     */
    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    /**
     * 获得字段 employee.manager_id 的值
     *
     * @return the value of employee.manager_id
     */
    public String getManagerId() {
        return managerId;
    }

    /**
     * 设置字段 employee.manager_id 的值
     *
     * @param managerId the value for employee.manager_id
     */
    public void setManagerId(String managerId) {
        this.managerId = managerId;
    }

    /**
     * 获得字段 employee.manager_name 的值
     *
     * @return the value of employee.manager_name
     */
    public String getManagerName() {
        return managerName;
    }

    /**
     * 设置字段 employee.manager_name 的值
     *
     * @param managerName the value for employee.manager_name
     */
    public void setManagerName(String managerName) {
        this.managerName = managerName;
    }

    /**
     * 获得字段 employee.enable 的值
     *
     * @return the value of employee.enable
     */
    public Boolean getEnable() {
        return enable;
    }

    /**
     * 设置字段 employee.enable 的值
     *
     * @param enable the value for employee.enable
     */
    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    /**
     * 获得字段 employee.create_date 的值
     *
     * @return the value of employee.create_date
     */
    public Date getCreateDate() {
        return createDate;
    }

    /**
     * 设置字段 employee.create_date 的值
     *
     * @param createDate the value for employee.create_date
     */
    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }
    
    // spring security 用来表示账号
    @Override
	public String getUsername() {
		return account;
	}

	@Override
	public boolean isAccountNonExpired() {
		return isEnabled();
	}

	@Override
	public boolean isAccountNonLocked() {
		return isEnabled();
	}

	@Override
	public boolean isCredentialsNonExpired() {
		return isEnabled();
	}

	@Override
	public boolean isEnabled() {
		if (enable == null) {
			return false;
		}
		return enable;
	}

	public List<ModuleMenu> getModuleMenuList() {
		return moduleMenuList;
	}

	public void setModuleMenuList(List<ModuleMenu> moduleMenuList) {
		this.moduleMenuList = moduleMenuList;
	}

	public void setAuthorities(Set<GrantedAuthority> authorities) {
		this.authorities = authorities;
	}

	@Override
	public Collection<? extends GrantedAuthority> getAuthorities() {
		return authorities;
	}

	@Override
	public Long getUserId() {
		return null;
	}

	public String getRoleIds() {
		return roleIds;
	}

	public void setRoleIds(String roleIds) {
		this.roleIds = roleIds;
	}

	public Integer getEcho() {
		return echo;
	}

	public void setEcho(Integer echo) {
		this.echo = echo;
	}

	@Override
	public List<? extends Authority> getAuthorityList() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void setAuthorityList(List<? extends Authority> authorityList) {
		// TODO Auto-generated method stub
	}

	@Override
	public String getTenantId() {
		return null;
	}

	@Override
	public String getTenantCode() {
		// TODO Auto-generated method stub
		return null;
	}
}